import request from "@/utils/request";
// 菜单基础URL

const CommonApi = {
  //查看图表
  getEchartsInfo(queryParams: any) {
    return request<any>({
      url: "orderStat/list",
      method: "get",
      params: queryParams,
    });
  },
  //城市图表
  getEchartsCityInfo(queryParams: any) {
    return request<any>({
      url: "orderStat/city",
      method: "get",
      params: queryParams,
    });
  },
  /**
   *
   * @returns 供应商
   */
  getSupplier(queryParams: any) {
    return request<any>({
      url: "supplierInfo/list",
      method: "get",
      params: queryParams,
    });
  },
  //修改供应商账号
  updateSupplierAccount(data: any) {
    return request<any>({
      url: "supplierApproval/edit",
      method: "post",
      data: data,
    });
  },
  //查询司机
  getDriver(queryParams: any) {
    return request<any>({
      url: "driverInfo/list",
      method: "get",
      params: queryParams,
    });
  },

  /**
   *
   * @param queryParams 城市查询
   * @returns
   */
  getCity(queryParams: any) {
    return request<any>({
      url: "common/cityList",
      method: "get",
      params: queryParams,
    });
  },
  //查询车系
  getCars(queryParams: any) {
    return request<any>({
      url: "vehicleSeries/list",
      method: "get",
      params: queryParams,
    });
  },
  //省市区联动
  getAreaList(queryParams: any) {
    return request<any>({
      url: "area/list",
      method: "get",
      params: queryParams,
    });
  },
  //oss存储
  getOssParam(queryParams: any) {
    return request<any>({
      url: "file/getOssParam",
      method: "get",
      params: queryParams,
    });
  },
  //根据参数发送请求
  common(data: any, url: any, method: any) {
    return request<any>({
      url,
      method,
      data,
      headers: {
        "Content-Type": "multipart/form-data",
      },
    });
  },
};

export default CommonApi;
